import request from '@/utils/request'

// 查询数据列表列表
export function listDataList(query) {
  return request({
    url: '/dataList/dataList/list',
    method: 'get',
    params: query
  })
}

// 查询数据列表详细
export function getDataList(dataId) {
  return request({
    url: '/dataList/dataList/' + dataId,
    method: 'get'
  })
}

// 新增数据列表
export function addDataList(data) {
  return request({
    url: '/dataList/dataList',
    method: 'post',
    data: data
  })
}

// 修改数据列表
export function updateDataList(data) {
  return request({
    url: '/dataList/dataList',
    method: 'put',
    data: data
  })
}

// 删除数据列表
export function delDataList(dataId) {
  return request({
    url: '/dataList/dataList/' + dataId,
    method: 'delete'
  })
}

// 清空当前分类数据
export function removeAllDataListByDataClassification(dataIds, type) {
  return request({
    url: '/dataList/dataList/removeDataListByDataClassificationId/' + dataIds +  '/' + type,
    method: 'delete'
  })
}
// 清空筛选分类数据
export function removeFilterDataList(classificationId) {
  return request({
    url: '/dataList/dataList/removeDataListByDataClassificationIdByConfigJson/' + classificationId,
    method: 'delete'
  });
}
// 数据列表批量转移
export function dataBatchPaste(data) {
  return request({
    url: '/dataList/dataList/batchPaste',
    method: 'post',
    data: data
  })
}

// 数据列表-分类
export function dataListClassification(data) {
  return request({
    url: '/dataClassification/dataClassification/allList',
    method: 'post',
    data: data
  });
}

// 查询筛选配置
export function getSettingFilter(data) {
  return request({
    url: '/home/getPageJson',
    method: 'post',
    data: data
  });
}

// 设置筛选配置
export function setSettingFilter(data) {
  return request({
    url: '/home/setPageJson',
    method: 'post',
    data: data
  });
}
